Ext.define('Risk.view.areaInfo.Charts',{
    extend:'Ext.window.Window',
    alias:'widget.charts',
    title:'项目信息浏览',
    renderTo : Ext.getBody(),
    autoShow:true,
    projid:null,
    modal:true,
    height:550,
    autoScroll :true,
    defaults:{
        xtype:'fieldset',
        margin:10
    },
    items:[{
        title:'项目基本信息',
        items:[{
	            xtype:'form',
	            frame:true,
	            style:'background-color:#DFE8F6;border:none;',
	            layout:{
		            type:'table',
		            columns:3
	            },
	            defaults:{
	                xtype:'textfield',
		            readOnly:true,
		            labelWidth:150,
		            width:248,
		            labelAlign:'right',
		            fieldStyle:'border:none;background-color: #DFE8F6;background-image: none;'
	            },
	            items:[{
		            fieldLabel:'评估对象名称',
		            name:'projname'
		        },{
		            fieldLabel:'评估对象类型',
		            name:'projtype'
		        },{
		            fieldLabel:'人身伤亡分量[R1]',
		            name:'r1'
		        },{
		            fieldLabel:'公共服务分量[R2]',
		            name:'r2'
		        },{
		            fieldLabel:'文化遗产损失分量[R3]',
		            name:'r3'
	           }]
        }]
    },{
        title:'评估结果',
        items:[{
        	itemId:'chart12',
            xtype:'chart',
            width:750,
            height:200,
            store:'areaStore.ChartStore',
            animate:true,
            axes:[{
                type:'Numeric',
                position:'left',
                fields:'value',
                title:'风险值'
            },{
                type:'Category',
                position:'bottom',
                fields:'type',
                title:'风险分量'
            }],
            series:[{
                type:'bar',
                trackMouse: true,
                column:true,
                showMarkers:true,
                axis:'bottom',
                xField:'type',
                yField:'value',
                highlight: true,
                tips: {
                      trackMouse: true,
                      width: 110,
                      height: 50,
                      renderer: function(storeItem, item) {
                          this.setTitle(storeItem.get('type')+"的值为"+"<font color='red'>"+storeItem.get('value')+"</font>");
                      }
                 }
            }]
        }]
    },{
        title:'风险比例图',
        layout:{
            type:'table',
            columns:4
        },
        defaults:{
            xtype:'chart',
            animate:true,
            width:180,
            height:120,
            animate: {
                easing: 'bounceOut',
                duration: 500
            },
            insetPadding: 25,
            flex: 1,
            font:'12px',
            axes: [{
                type: 'gauge',
                position: 'gauge',
                minimum: 0,
                maximum: 100,
                steps: 5,
                margin: 5
                
            }],
            series: [{
                type: 'gauge',
                field: 'value',
                title:'a',
                donut: 60,
                colorSet: ['#3AA8CB', '#ddd'],
                highlight: true,
                tips: {
                      trackMouse: true,
                      width: 150,
                      height: 50,
                      renderer: function(storeItem, item) {
                          this.setTitle(storeItem.get('type')+"：<font color='red'>"+storeItem.get('value')+"</font>");
                      }
                 }
            }]
        },
        items:[{
            xtype:'label',
            html:'<font size=1px>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;雷击建筑物风险损失所占比例</font>'
        },{
            xtype:'label',
            html:'<font size=1px>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;雷击电力服务设施损失所占比例</font>'
        },{
            xtype:'label',
            html:'<font size=1px>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;雷击信息服务设施损失所占比例<size=1>'
        },{
            xtype:'label',
            html:'<font size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;电磁辐射引起内部系统损失所占比例</font>'
        },{
        	itemId:'pies1',
            store: 'areaStore.PieStore1'
        },{
        	itemId:'pies2',
            store:'areaStore.PieStore2'
        },{
        	itemId:'pies3',
            store:'areaStore.PieStore3'
        },{
        	itemId:'pies4',
            store:'areaStore.PieStore4'
        }]
    }]
})